<? 
	$title="User List"; 
	$pageid="4";
	$accessid=",a10,";
	require("required/dbconnect.php"); 
	require("required/function.php");
	if(isset($_POST['btnsetting']))
	{
		$use_flat_rate=$_POST['use_flat_rate'];
		
		mysql_query("update os_contactinfo set use_flat_shipping_rate=$use_flat_rate where id=1")or die(mysql_error());
		header("Location:shipping_view_all.php?action=4");		
	}
	require("required/header.php");
	
 	checkAccess("allow_shipping_management",1);
	
	$get_branch=mysql_query("select * from os_shipping_company order by company_name asc")or die(mysql_error());
	
?>
<script src="required/js/jquery-1.4.2.js"></script>
<script src="required/js/common_javascript.js"></script>
<?	
		
	if(!empty($_GET['action']))
	{
		switch($_GET['action'])
		{
			case 1:
				$msg="<div class='dw_success'>Data inserted</div>";
				break;
			case 2:
				$msg="<div class='dw_success'>Data Deleted</div>";
				break;
			case 3:
				$msg="<div class='dw_success'>Data Updated</div>";
				break;
			case 4:
				$msg="<div class='dw_success'>Setting Updated</div>";
				break;			
			default:
				$msg="";
				break;
		}
		echo "<script>displayMsg('divMsg')</script>";	
	}else{
		$msg="";
	}
	
	
	
?>
<table width="100%"  cellpadding="0" cellspacing="5" height="300">
<tr>

	<td valign="top">
		<font class="title">Shipping Company</font><br><br>
        <div id="divMsg"><?= $msg ?></div>
        	
        
			<table width="100%" class="solidborder">
				<tr class="table_header">
					<td width="3%">No</td><td width="40%">Shipping Company</td><td width="11%">Action</td>
				</tr>
				<? if(mysql_num_rows($get_branch)==0){ ?>
				<tr valign="top">
					<td align="center" colspan="7">
					- No record found - 
					</td>
				
				<? 
					}
					else
					{
						$no=1;
						while($a=mysql_fetch_array($get_branch,MYSQL_ASSOC))
						{
							$id=$a['id'];
							if($no%2==0)
							{
								$class1="table_item_even";
								$class2="table_item_odd";
							}
							else
							{
								$class1="table_item_odd";
								$class2="table_item_even";
							}
							
							if($a['status']==0)
							{
								$status="No";
							}
							else
							{
								$status="Yes";	
							}
							
							
				?>
			  <tr height="20" valign="top" class="<?= $class1 ?>"  onmouseover="this.className='table_item_mouseover'" 
                            onmouseout="this.className='<?= $class1 ?>'">
						<td align="center"><?= $no ?></td>
						<td><?= $a['company_name'] ?></td>
						
						<td align="center">
                        <a href="shipping_view_full.php?id=<?= $id ?>"> <img src="images/icons/view_icon.gif" border="0"></a>
                       </td>								
			  </tr>
				<? 
					$no++; 
						}
					}
				?>
				
			</table>
			
		
		
		</td>
	</tr>
	
	
</table>
<? require("required/footer.php"); ?>

